package com.test.dubbo;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

public class DubboEncoder extends MessageToByteEncoder<DubboProtocol>
{
	@Override
	protected void encode(ChannelHandlerContext ctx, DubboProtocol msg, ByteBuf out) throws Exception {
		out.writeInt(msg.getLen());
		out.writeBytes(msg.getContent());
	}
}